
<style>
form{border: 1px solid #ccc;padding: 5px;}
.form-horizontal .form-group{margin:0;}
</style>

<div class="tab-content">
  <div role="tabpanel" class="tab-pane active" id="OrderInfo">
      <div class="ui-portlet clearfix">
          <div class="ui-portlet-header">
              <span class="title">订单信息</span>
          </div>
          <div class="ui-portlet-content">
    <div class="clearfix">
        <label class="col-sm-2">订单编号：</label>
        <div class="col-sm-9 controls">
            <span style="color:red"> {{$datainfo['Order']['id']}}</span>

            <small>{{if $datainfo['Order']['model']}}<span style="margin-left:50px;"> model:{{$datainfo['Order']['model']}}</span>{{/if}}
                {{if $datainfo['Order']['data_id']}} <span style="margin-left:50px;"> data_id:{{$datainfo['Order']['data_id']}}</span>{{/if}}</small>
        </div>
    </div>
    <div class="clearfix">
        <label class="col-sm-2">订单金额：</label>
        <div class="col-sm-9 controls">
            <span class="product-price"> {{$datainfo['Order']['total_price']}}</span>

            {{if $datainfo['Order']['ship_fee'] > 0 }}<small style="margin-left:50px;">快递费：{{$datainfo['Order']['ship_fee']}}</small>{{/if}}
        </div>
    </div>

    <hr style="margin:10px 0;">
    <div class="clearfix">
        <label class="col-sm-2">订单状态：</label>
        <div class="col-sm-9 controls">

            {{if $datainfo['Order']['status'] > 0 }}
                <strong style="color:green;">
            {{else}} <strong style="color:red;">
            {{/if}}
            {{$status[$datainfo['Order']['status']]}}</strong>

            <small>状态码：{{$datainfo['Order']['status']}}</small>
        </div>
    </div>
    <div class="clearfix">
        <label class="col-sm-2">订单时间：</label>
        <div class="col-sm-9 controls">
            {{$datainfo['Order']['created']}}
        </div>
    </div>
    <div class="clearfix">
        <label class="col-sm-2">订单用户：</label>
        <div class="col-sm-9 controls">
            {{$datainfo['Order']['creator']}}
        </div>
    </div>
  <div class="clearfix">
      <label class="col-sm-2">订单收件人：</label>
      <div class="col-sm-9 controls">
          {{$datainfo['Order']['consignee_province']}} {{$datainfo['Order']['consignee_city']}}&nbsp;{{$datainfo['Order']['consignee_area']}} &nbsp;
          {{$datainfo['Order']['consignee_address']}} &nbsp; {{$datainfo['Order']['consignee_mobilephone']}}  &nbsp; {{$datainfo['Order']['consignee_name']}}
      </div>
  </div>

      <div class="clearfix">
          <label class="col-sm-2">订单Shop_id：</label>
          <div class="col-sm-9 controls">
              {{$datainfo['Order']['shop_id']}}
          </div>
      </div>
      <div class="clearfix">
          <label class="col-sm-2">订单子商户：</label>
          <div class="col-sm-9 controls">
              {{$datainfo['Order']['mch_id']}}  {{if $datainfo['Order']['customer_id']}}<span style="margin-left:50px;">customer_id:{{$datainfo['Order']['customer_id']}}</span> {{/if}}
          </div>
      </div>
      <div class="clearfix">
          <label class="col-sm-2">其他：</label>
          <div class="col-sm-9 controls">
              {{$datainfo['Order']['source']}} &nbsp;
              {{$datainfo['Order']['serialize_info']}} &nbsp;
              {{$datainfo['Order']['pickup_address']}} &nbsp;
              {{$datainfo['Order']['nickname']}} &nbsp;
              {{$datainfo['Order']['remark']}}
          </div>
      </div>
  </div></div>
   <?PHP  $user_id = $datainfo['Order']['creator']; $total_price = 0; ?>


   <div class="ui-portlet-header">
			      <span class="title">订单商品记录</span>            
	</div>
   <table class="table table-bordered">
   	<thead><tr><th>商品编号</th><th>商品类型</th><th>商品名</th><th>加入购物车时间</th><th>价格</th><th>数量</th><th>合计</th><th>操作</th></tr></thead>
   	<portlet cache="no" list_tpl="inner" portlet="body"  model="Cart" limit="100" fields="Cart.*" order="id desc" info="conditions[order_id]=$id&conditions[creator]=$user_id&conditions[status]=1">
   		<tr><td>{{$item['product_id']}}</td><td>{{$item['product_model']}}</td><td>{{$item['name']}}</td><td>{{$item['created']}}</td><td><strong>{{$item['price']}}</strong></td><td><strong>{{$item['num']}}</strong></td><td>{{$item['price']*$item['num']}}</td><td><a href="/admin/{{Inflector::tableize($item['product_model'])}}/view/{{$item['product_id']}}" target="_blank">查看商品</a></td></tr>
   		<?PHP $total_price += $item['price']*$item['num']; ?>
   	</portlet>
       <tr><td colspan="8"><P>未优惠前金额：<span style="color:red;">{{$total_price}}</span></P></td></tr>
   </table>


  <portlet cache="no" list_tpl="inner" portlet="body"  model="RefundLog" limit="100" fields="RefundLog.*" order="id desc" info="conditions[order_id]=$id">
      {{if $key==0}}
      <div class="ui-portlet-header">
          <span class="title" style="color:orange;">订单已退款记录</span>
      </div>
      <table class="table table-bordered">
          <thead><tr><th>退款记录编号</th><th>支付方式</th><th>支付交易号</th><th>退款人编号</th><th>退款单号</th><th>退款时间</th><th>退款金额</th></tr></thead>
          {{/if}}
          <tr><td>{{$item['id']}}</td><td>{{$item['pay_method']}}</td><td>{{$item['transaction_id']}}</td><td>{{$item['staff_id']}}</td><td>{{$item['refund_no']}}</td><td>{{$item['created']}}</td><td><span class="product-price">{{$item['refund_fee']}}</span></td></tr>
          {{if $key==$count-1}}</table> {{/if}}
  </portlet>


  <div class="ui-portlet-header">
      <span class="title">订单支付记录</span>
  </div>
  <table class="table table-bordered">
    <thead><tr><th>支付记录编号</th><th>支付方式</th><th>银行</th><th>用户编号</th><th>币种</th><th>支付时间</th><th>支付金额</th><th>支付交易号</th><th>操作</th></tr></thead>

    <portlet cache="no" list_tpl="inner" portlet="body"  model="PayLog" limit="100" fields="PayLog.*" order="id desc" info="conditions[order_id]=$id">
        <tr><td>{{$item['id']}}</td><td>{{$item['pay_method']}}</td><td>{{$item['bank_type']}}</td><td>{{$item['user_id']}}</td><td>{{$item['fee_type']}}</td><td>{{$item['created']}}</td><td><span class="product-price">{{$item['total_fee']}}</span></td><td>{{$item['transaction_id']}}</td><td><a href="/admin/orders/refund/{{$item['order_id']}}/{{$item['id']}}">退款</a></td></tr>
   	</portlet>
          {{if $count==0}}
      <tr><td colspan="9">没有支付记录</td></tr>
          {{/if}}
   </table>

   <div class="ui-portlet-header">
	<span class="title">用户信息</span>            
</div>

   <table class="table table-bordered">
      	<thead><tr><th>用户编号</th><th>用户名称</th><th>用户手机</th><th>用户邮箱</th><th>注册时间</th><th>操作</th></tr></thead>
   <portlet cache="no" list_tpl="inner" portlet="body"  model="User" limit="100" fields="*" order="id desc" info="recursive=-1&conditions[id]=$user_id">
	<tr><td>{{$item['id']}}</td><td>{{$item['username']}}</td><td>{{$item['mobile']}}</td><td>{{$item['email']}}</td><td>{{$item['created']}}</td><td><a href="/admin/users/view/{{$item['id']}}" target="_blank">查看</a></td></tr>
</portlet>
</table>

<portlet cache="no" list_tpl="inner" portlet="body"  model="Oauthbind" limit="100" fields="*" order="id desc" info="conditions[user_id]=$user_id">
    {{if $key==0}}
    <div class="ui-portlet-header">
        <span class="title">用户第三方账号授权</span>
    </div>

    <table class="table table-bordered">
        <thead><tr><th>授权编号</th><th>授权来源</th><th>用户名称</th><th>授权时间</th><th>Openid</th><th>token</th><th>slug</th></tr></thead>
    {{/if}}


    <tr><td>{{$item['id']}}</td><td>{{$item['source']}}</td><td>{{$item['oauth_name']}}</td><td>{{$item['created']}}</td><td>{{$item['oauth_openid']}}</td><td>{{$item['oauth_token']}}</td><td>{{$item['domain']}}</td></tr>
    {{if $key==$count-1}}</table> {{/if}}
</portlet>

   
   
   </div>
   
</div>